#ifndef	____CAR_CONTROL_H_____
#define	____CAR_CONTROL_H_____

#include "gpio.h"
#include "pwm.h"


typedef struct car_cfg_{
        GPIO *lw_gpioA;
	GPIO *lw_gpioB;
        GPIO *rw_gpioA;       
        GPIO *rw_gpioB;
        PWM  *lw_can;
        PWM  *rw_can;
}car_cfg;


typedef struct robot_car_ {
	car_cfg *cfg;

} robot_car;


int car_init(robot_car* cfg);

int car_move_on(robot_car* cfg);

int car_stop(robot_car* cfg);

int car_back_up(robot_car* cfg);

int car_turn_left(robot_car* cfg);

int car_turn_right(robot_car* cfg);

int car_speed_up(robot_car* cfg);

int car_speed_down(robot_car* cfg);

int car_uninit(robot_car* cfg);



#endif
